import requestProxy from '@/utils/request';
// import { data } from 'autoprefixer';

const { request } = requestProxy;

export function costList(params) {
  return request({
    url: '/admin/order/cost/list',
    method: 'get',
    params
  });
}
export function addCost(data) {
  return request({
    url: '/admin/order/cost/add',
    method: 'post',
    data
  });
}

export function editCost(data) {
  return request({
    url: '/admin/order/cost/edit',
    method: 'put',
    data
  });
}
export function deleteCost(data) {
  return request({
    url: '/admin/order/cost/delete/' + data.id,
    method: 'delete',
    data
  });
}

export function getOrderCost(params) {
  return request({
    url: '/admin/order/cost',
    method: 'get',
    params
  });
}

export function getChartsTab(params) {
  return request({
    url: '/admin/charts/tab',
    method: 'get',
    params
  });
}

export function editChartsTab(data) {
  return request({
    url: '/admin/charts/edit/tab/' + data.id,
    method: 'put',
    data
  });
}
export function createChartsTab(data) {
  return request({
    url: '/admin/charts/create/tab',
    method: 'post',
    data
  });
}
export function deleteChartsTab(data) {
  return request({
    url: '/admin/charts/tab/delete/' + data.id,
    method: 'delete',
    data
  });
}
export function chartsTabDetail(params) {
  return request({
    url: '/admin/charts/tab/detail',
    method: 'get',
    params
  });
}

export function getDepartmentAll(params) {
  return request({
    url: '/admin/department/all',
    method: 'get',
    params
  });
}

// 订单分类列表
export function getOrderKindList(params) {
  return request({
    url: 'admin/order/kind/list',
    method: 'get',
    params
  });
}

// 订单分类列表-编辑
export function orderKindEdit(id, data) {
  return request({
    url: `admin/order/kind/edit/${id}`,
    method: 'put',
    data
  });
}

// 订单分类列表-新增
export function orderKindAdd(data) {
  return request({
    url: 'admin/order/kind/add',
    method: 'post',
    data
  });
}

// 订单分类列表-删除
export function orderKindDel(id) {
  return request({
    url: `admin/order/kind/del/${id}`,
    method: 'delete'
  });
}

// 收入项配置-收入项列表
export function getIcomeKindList(params) {
  return request({
    url: 'admin/income/kind/list',
    method: 'get',
    params
  });
}

// 收入项配置-收入项删除
export function incomeKindDel(id) {
  return request({
    url: `admin/income/kind/delete/${id}`,
    method: 'delete'
  });
}

// 收入项配置-收入项编辑
export function incomeKindEdit(id, data) {
  return request({
    url: `admin/income/kind/edit/${id}`,
    method: 'post',
    data
  });
}

// 收入项配置-收入项新建
export function incomeKindCreate(data) {
  return request({
    url: 'admin/income/kind/create',
    method: 'post',
    data
  });
}

// 收入项配置-收入项新建
export function getIncomeSources() {
  return request({
    url: 'admin/income/sources',
    method: 'get'
  });
}

// 获取所有标签
export function getTagAll(params) {
  return request({
    url: '/admin/tag/all',
    method: 'get',
    params
  });
}

export function getNoticeList(params) {
  return request({
    url: '/admin/advise/task/list',
    method: 'get',
    params
  });
}
export function noticeDel(data) {
  return request({
    url: `/admin/advise/task/delete/${data.id}`,
    method: 'delete'
  });
}
export function noticeAdd(data) {
  return request({
    url: '/admin/advise/task/create',
    method: 'post',
    data
  });
}
export function noticeEdit(data) {
  return request({
    url: `/admin/advise/task/edit/${data.id}`,
    method: 'put',
    data
  });
}
// 收入细项
export function getIncomDetailList(params) {
  return request({
    url: `admin/mengli/incomeDetailList`,
    method: 'get',
    params
  });
}
export function addRiskNotice(data) {
  return request({
    url: 'admin/risk/task/create',
    method: 'post',
    data
  });
}
export function editRiskNotice(data) {
  return request({
    url: `/admin/risk/task/edit/${data.id}`,
    method: 'put',
    data
  });
}
export function getRiskNoticeList(params) {
  return request({
    url: '/admin/risk/task/list',
    method: 'get',
    params
  });
}
export function delRiskNotice(data) {
  return request({
    url: `/admin/risk/task/delete/${data.id}`,
    method: 'delete'
  });
}
